-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hoc loading error states #1589
Hoc loading error states #1589
Conversation
…ner for all three article states
…the RequestContext & ServiceContext
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Loveee this, so clean and simple and modular 😍
Also this PR is draft, so soz for the review but its so close to being great 🙈
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests as they stand provide enough coverage against breakage, let's raise a separate issue to improve them further if needed - this work is a blocker for others and we need to finish it up. Thanks @hindsc52 for taking this on and everyone for their reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Blocked by #1661 |
5f64100
Please note the current CC issues are for tests so can be ignored. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Happy for this to be merged. |
Resolves #1248
Overall change:
This PR branches from @sareh original MVP loading state, with the intention of making the Loading and error states more re-useable when adding different page types.
This is done by using HOC (Higher Order Components) to provide a loading and an error state. This enables to reduce of a lot of complexity in the article container and in the future homepage container, removing the need for these to know about error and loading states.
It also introduces a
PageWrapper
that is used to load the necessary page furniture which should be fairly similar if not the same across articles and homepages.I would want to refactor this some more at a later date by producing a Layout that then wraps each page type container, again reducing the required logic in both the article and the homepage containers.
Code changes: